﻿using System;

namespace DataModel.Models
{
    public class GroupModel
    {
        public Guid Id { get; set; }
        public long Number { get; set; }
        public DateTime EntranceDate { get; set; }
        public int AmountYears { get; set; }
        public int CurrentSemester { get; set; }

        public bool IsStudy
        {
            get { return DateTime.Today < EntranceDate.AddYears(AmountYears); }
        }

        public GroupModel() { }

        public GroupModel(Group group)
        {
            Number = group.number;
            EntranceDate = group.entranceDate;
            AmountYears = group.amountYears;
            CurrentSemester = group.GetCurrentSemester();
            Id = group.ID;
        }
    }
}
